<template>
    <header>
        <h1>{{msg}}</h1>
        <h2><input type="text" v-model="inputText" /></h2>
        <p><input type="button" @click="changeText" /></p>
    </header>
</template>
<script>
export default {
  data(){
    return{
      inputText:"这里可以改变啊"
    };
  },
  name:'Header',
  props: {
    msg: String
  },
  methods:{
    changeText:function(){
      this.$store.commit('newAuthor',this.inputText);
    }
  }
}
</script>
